package com.example.tests;

import static org.hamcrest.MatcherAssert.*;
import static org.hamcrest.Matchers.*;

import org.hamcrest.core.IsNot;
import org.testng.annotations.Test;

public class TestFolderCreation extends TestBase {
	
	@Test
	public void testFolderCreation(){
		String folder = "newfolder15";
		Folders oldFolders = app.getFolderHelper().getFolder();
		app.getFolderHelper().createFolder(folder);
		Folders newFolders = app.getFolderHelper().getFolder();
		assertThat(newFolders, equalTo(oldFolders.withAdded(folder)));
	}
/*
	@Test
	public void testVariousFoldersCreation(){
		String folder1 = "newfolder23";
		String folder2 = "newfolder24";
 		Folders oldFolders = app.getFolderHelper().getFolder();
		assertThat(app.getFolderHelper().createFolder(folder1), is(nullValue()));
		Folders newFolders = app.getFolderHelper().getFolder();
		assertThat(newFolders, equalTo(oldFolders.withAdded(folder1)));
		
		assertThat(app.getFolderHelper().createFolder(folder2), is(nullValue()));
		Folders newFolders2 = app.getFolderHelper().getFolder();
		assertThat(newFolders2, equalTo(newFolders.withAdded(folder2)));
	}

	@Test
	public void testFoldersWithSameNameCreation(){
		String folder = "newfolder13";
 		Folders oldFolders = app.getFolderHelper().getFolder();
 		assertThat(app.getFolderHelper().createFolder(folder), is(nullValue()));
		Folders newFolders = app.getFolderHelper().getFolder();
		assertThat(newFolders, equalTo(oldFolders.withAdded(folder)));
		
		assertThat(app.getFolderHelper().createFolder(folder), containsString("Dublicate folder name"));
		Folders newFolders2 = app.getFolderHelper().getFolder();
		assertThat(newFolders2, equalTo(newFolders));
	}
*/
}
